<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>

<body>

</body>
<script>
    {
        // 如果所有元素都通过检测返回 true，否则返回 false。
        console.log('**********every***********');
        let arr = [3, 56, 78, 99]
        let res = arr.every((cur, index) => {
            return cur > 60
        })
        console.log(res);  //false
    }
    {
        console.log('**********map***********');
        let arr = [true, false, false, true]
        let res = arr.map((item) => {
            return item = false

        })
        console.log(res); // [false, false, false, false]
    }
    {
        console.log('**********map***********');
        let arr = [{ a: 1 }, { a: 4 }]
        let res = arr.map((item) => {
            return item.a = 9999

        })
        console.log(res);  //[9999, 9999]
    }
    {
        console.log('**********filter***********');
        let arr = [{ a: 1 }, { a: 4 }]
        let res = arr.filter((item) => {
            return item.a = 9999

        })
        console.log(res);
        /* 
        0: {a: 9999}
        1: {a: 9999}
        */
    }
    {
        console.log('**********filter***********');
        let arr = [true, false, false, true]
        let res = arr.filter((item) => {
            // 基本数据类型不能修改
            item = false

        })
        console.log(res);
    }
    {
        console.log('**********forEach***********');
        let arr = [true, false, false, true]
        let res = arr.forEach((item) => {
            // 基本数据类型不能修改
            item = false

        })
        console.log(res);
    }
</script>

</html>